
import Layout from '@/layout'
import auth from '@/components/auth-redirect.vue'

const asyncRoutes = [
  {
    path: '/permission',
    component: Layout, redirect: '/permission/page',
    meta: {
      title: 'Permission',
      icon: 'lock',
      roles: ['admin', 'editor'] // you can set roles in root nav
    },
    children: [
      { path: 'page',basepath:'/permission/page',name:'Page Permission', component: () => import('@/components/permission/page.vue'),meta: {
          title: 'Page Permission',
          roles: ['admin','editor'] // or you can only set roles in sub nav
        }}
    ]
  }
  // {
  //   path: '/permission',
  //   component: Layout,
  //   redirect: '/permission/page',
  //   // alwaysShow: true, // will always show the root menu
  //   name: 'Permission',
  //   meta: {
  //     title: 'Permission',
  //     icon: 'lock',
  //     roles: ['admin', 'editor'] // you can set roles in root nav
  //   },
  //   children: [
  //     {
  //       path: 'page',
  //       component: () => import('@/components/permission/page.vue'),
  //       name: 'PagePermission',
  //       meta: {
  //         title: 'Page Permission',
  //         roles: ['admin'] // or you can only set roles in sub nav
  //       }
  //     },
  //     {
  //       path: 'directive',
  //       component: () => import('@/components/permission/directive.vue'),
  //       name: 'DirectivePermission',
  //       meta: {
  //         title: 'Directive Permission'
  //         // if do not set roles, means: this page does not require permission
  //       }
  //     },
  //     {
  //       path: 'role',
  //       component: () => import('@/components/permission/role.vue'),
  //       name: 'RolePermission',
  //       meta: {
  //         title: 'Role Permission',
  //         roles: ['editor']
  //       }
  //     }
  //   ]
  // }
]
export default asyncRoutes